state=input()
income=float(input())
if state=="s":
     if income>125000:
        tax=(12000-5000)*0.15+(125000-12000)*0.25+(income-125000)*0.35
     elif 12000<income<=125000:
          tax=(12000-5000)*0.15+(income-12000)*0.25
     elif 5000<income<=12000:
          tax=(income-5000)*0.15
     else:tax=0
     print(f"{tax:.2f}")
else:

     if income>250000:
         tax=(24000-10000)*0.15+(250000-24000)*0.25+(income-250000)*0.35
     elif 24000<income<=250000:
         tax=(24000-10000)*0.15+(income-24000)*0.25
     elif 10000<income<=24000:
         tax=(income-10000)*0.15
     else:tax=0
     print(f"{tax:.2f}")
